﻿#ifndef SERIALDIALOG_H
#define SERIALDIALOG_H

#include <QSerialPortInfo>

#include "../HWBaseDialog/HWBaseDialog.h"

namespace Ui {
class SerialDialog;
}

class SerialDialog : public HWBaseDialog
{
    Q_OBJECT

public:
    explicit SerialDialog(QWidget *parent = nullptr);
    ~SerialDialog();

    int exec() override;

    static QString serialPortInfo2String(const QSerialPortInfo& port);

private slots:
    void setUIEnabled(bool en) override;

    void on_btnRefresh_clicked();

    void on_btnOpen_clicked();

    void on_btnCancel_clicked();

private:
    Ui::SerialDialog *ui;
    QList<QSerialPortInfo> m_ports;
};

#endif // SERIALDIALOG_H
